]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: escape the tray when a legacy icon is clicked
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 31 Aug 2012 16:43:00 +0000 (18:43 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 1 Sep 2012 14:38:51 +0000 (16:38 +0200)
Legacy tray icons may want to take a pointer grab to show a popup menu,
and this is incompatible with message tray modality. To solve this,
escape the tray when forwarding clicks to the tray icons, and wait
for the input mode change to actually synthetize the X event.

https://bugzilla.gnome.org/show_bug.cgi?id=682244

js/ui/messageTray.js
js/ui/notificationDaemon.js

index 7ada61685986fa0bb2b48af5768ecef6f3edb6c9..a382c799a7f30cbf122bb54e73418060f3640773 100644 (file)
@@ -1740,7 +1740,7 @@ const MessageTray = new Lang.Class({
 
     _onSummaryItemClicked: function(summaryItem, button) {
         if (summaryItem.source.handleSummaryClick()) {
-            this._setClickedSummaryItem(null);
+            this._escapeTray();
         } else {
             if (!this._setClickedSummaryItem(summaryItem, button))
                 this._setClickedSummaryItem(null);
index fb580fe107a8dac203f8719e6b8de07bd5604f23..5b41197d12ee3a52a1c8e18531f3ddb1d3f02aa7 100644 (file)
@@ -583,18 +583,12 @@ const Source = new Lang.Class({
             this.notifications.length > 0)
             return false;
 
-        if (Main.overview.visible) {
-            // We can't just connect to Main.overview's 'hidden' signal,
-            // because it's emitted *before* it calls popModal()...
-            let id = global.connect('notify::stage-input-mode', Lang.bind(this,
-                function () {
-                    global.disconnect(id);
-                    this.trayIcon.click(event);
-                }));
-            Main.overview.hide();
-        } else {
+        let id = global.connect('notify::stage-input-mode', Lang.bind(this, function () {
+            global.disconnect(id);
             this.trayIcon.click(event);
-        }
+        }));
+
+        Main.overview.hide();
         return true;
     },